package bookManager;

import bookManager.operations.IOperation;

import java.util.Arrays;

abstract public class User {
    private int userId;
    private String name;
    private String password;

    IOperation[] Operations;

    public abstract int menu();

    public void doOperation(int choice){
        Operations[choice].work();
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", Operations=" + Arrays.toString(Operations) +
                '}';
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
